/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-04-16
 * Time: 17:20
 */
import java.util.*;

 class Bonus {

    public int getMost(int[][] board) {
        for(int i=1;i<board.length;i++){
            board[i][0]+=board[i-1][0];
        }
        for(int i=1;i<board[0].length;i++){
            board[0][i]+=board[0][i-1];
        }
        for(int i=1;i<board.length;i++){
            for(int j=1;j<board[i].length;j++){
                board[i][j]+=Math.max(board[i][j-1],board[i-1][j]);
            }
        }
        return board[board.length-1][board[0].length-1];
    }
}
public class test3 {
    public static void main(String[] args) {

    }
}
